#include "reg52.h" 

sbit KEY1 = P3^1;
sbit KEY3 = P3^2;
sbit LED  = P2^0;

void delay(unsigned int i)
{
	while(i--);
}
void main()
{
  while(1)
	{
	  if(KEY1 == 0)
		{
		  delay(1000);
			if(KEY1 == 0)
			{
			  LED = 0;
			}	
		}
		if(KEY3 == 0)
				{
				  delay(1000);
					if(KEY3 == 0)
					{
					  LED = 1;
					}
					while(!KEY3);
				}
	}
}